package com.plian.system.vo.pf;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.system.entity.pf.PerformanceScoreMethod;
import com.plian.system.node.INode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Take-off
 * @Description: TODO
 * @Date: 2023/1/29 3:22 PM
 * @Version: 1.0
 **/
@Data
@ApiModel(value = "ScoreMethodVO 对象", description = "考核评分办法-VO")
public class ScoreMethodVO implements INode<Long, ScoreMethodVO> {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "父类Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    @ApiModelProperty(value = "指标名称")
    private String name;

    @ApiModelProperty(value = "考核评分办法")
    private List<PerformanceScoreMethod> scoreMethodList;

    @ApiModelProperty(value = "子项")
    private List<ScoreMethodVO> children;


    @Override
    public List<ScoreMethodVO> getChildren() {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        return this.children;
    }
}
